// @ts-ignore
import request from '/@/utils/request';

/**
 部门API
 */
export function useDeptApi() {
    return {
        add: (params?: object) => {
            return request({
                url: '/system-admin/sys-dept/add',
                method: 'post',
                data: params,
            });
        },
        getTree: () => {
            return request({
                url: '/system-admin/sys-dept/tree',
                method: 'get',
            });
        },
        getPage: (params?: object) => {
            return request({
                url: '/system-admin/sys-dept/page',
                method: 'post',
                data: params,
            });
        },
        edit: (params?: EditDataRow) => {
            return request({
                url: '/system-admin/sys-dept/edit',
                method: 'post',
                data: params,
            });
        },
        del: (params?: object) => {
            return request({
                url: '/system-admin/sys-dept/del',
                method: 'post',
                data: params,
            });
        },
        getAll: () => {
            return request({
                url: '/system-admin/sys-dept/getAll',
                method: 'get',
            });
        },
    };
}
